import React, { Component } from 'react';
import { HashRouter, Route, Switch} from 'react-router-dom';
import App from './App';
import Admin from './admin';
import Login from './pages/login';
import Home from './pages/home';
import Buttons from './pages/ui/buttons';
import Modals from './pages/ui/modals';
import Loadings from './pages/ui/loadings';
import OpenNotification from './pages/ui/notification';
import Message from './pages/ui/message';
import Tabs from './pages/ui/tabs';
import Gallery from './pages/ui/gallery';
import Carousel from './pages/ui/carousel';
import FormLogin from './pages/form/login';
import FormRegister from './pages/form/register';
import Basic from './pages/table/basic';
import High from './pages/table/high';
import City from './pages/city';
import Order from './pages/order';

import NoMatch from './pages/nomatch';

export default class Router extends Component{
	render() {
		return (
			<HashRouter>
				<App>
					<Switch>
						<Route path="/login" component={Login} />
						<Route path="/" render={() => 
							<Admin>
								<Switch>
									<Route path="/home" component={Home} />
									<Route path="/ui/buttons" component={Buttons} />
									<Route path="/ui/modals" component={Modals} />
									<Route path="/ui/loadings" component={Loadings} />
									<Route path="/ui/notification" component={OpenNotification} />
									<Route path="/ui/messages" component={Message} />
									<Route path="/ui/tabs" component={Tabs} />
									<Route path="/ui/gallery" component={Gallery} />
									<Route path="/ui/carousel" component={Carousel} />
									<Route path="/form/login" component={FormLogin} />
									<Route path="/form/reg" component={FormRegister} />
									<Route path="/table/basic" component={Basic} />
									<Route path="/table/high" component={High} />
									<Route path="/city" component={City} />
									<Route path="/order" component={Order} />
									<Route component={NoMatch} />
								</Switch>
							</Admin>
						} />
						<Route path="/order/detail" component={Login} />
					</Switch>
				</App>
			</HashRouter>
			);
	}
}